// ignore_for_file: unused_import, deprecated_member_use

import 'dart:io' show Platform;

import 'package:common/common.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';

import 'app_main.dart';
import 'theme/theme_model.dart';

void main(List<String> args) async {
  debugPrint('args: $args');

  WidgetsFlutterBinding.ensureInitialized();
  // 设置状态栏样式
  SystemUiOverlayStyle style = const SystemUiOverlayStyle(statusBarColor: Color(0xFFededed));
  SystemChrome.setSystemUIOverlayStyle(style);

  // AutoSizeUtil.setStandard(375, isAutoTextSize: true);
  // fast i18n use device locale
  WidgetsFlutterBinding.ensureInitialized();

  if (Device.isAndroid) {
    SystemUiOverlayStyle systemUiOverlayStyle = const SystemUiOverlayStyle(statusBarColor: Colors.transparent);
    SystemChrome.setSystemUIOverlayStyle(systemUiOverlayStyle);
  }
  //初始化SP
  await Storage().init();
  SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]).then((_) {
    runApp(
      MultiProvider(
        providers: [
          ChangeNotifierProvider(create: (_) => DefaultThemeData()),
        ],
        child: TUIKitDemoApp(),
      ),
    );
  });
}
